;;;Change attributes angles
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://paracadd.com
;;;	All rights reserved.
;;;
;;;	Copyright:  5-26-2010
;;;	   Edited:  5-26-2010
(defun c:attang ()
  (setq modcnt 0)
  (if ustr nil (load "ustr" "\nFile USTR.LSP not loaded! "))
  (if uangle nil (load "uangle" "\nFile UANGLE.LSP not loaded! "))
  (setq bmss (ssget))
  (setq bmcnt (1- (sslength bmss)))
  (while (>= bmcnt 0)
    (setq bment (entget (ssname bmss bmcnt)))
    (while (/= (cdr(assoc 0 bment)) "SEQEND")
      (if (eq (cdr (assoc 0 bment)) "ATTRIB")
          (progn
            (setq newattang
		   (uangle 1 "" "New attribute angle?" NIL
			   (IF (AND(ASSOC 11 bment)(ASSOC 72 bment)(ASSOC 74 bment)(OR(/=(CDR(ASSOC 72 bment))0)(/=(CDR(ASSOC 74 bment))0)))
			     (CDR (ASSOC 11 bment))
			     (CDR (ASSOC 10 bment))
			   )
                   )
            )
            (setq newent (subst (cons 50 newattang)(assoc 50 bment) bment))
            (if
              (entmod newent)
              (setq modcnt (1+ modcnt))
            )
	    (entupd (cdr(assoc -1 newent)))
          )
      )
      (setq bment (entget (entnext (cdr(assoc -1 bment)))))
    )
    (setq bmcnt (1- bmcnt))
  )
  (princ)
)